<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title>移动设备屏幕数据</title>
		<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
		<link rel="stylesheet" type="text/css" href="css/reset.css"/>
		<style type="text/css">
			.layer {
				position: absolute;
				left: 0;
				right: 0;
				top: 0;
				bottom: 0;
			}
		</style>
	</head>
	<body>
		<div class="layer"></div>
		<p id="visible"></p>
		<p id="screen"></p>
		<p id="screen_view"></p>
		<p id="ratio"></p>
		<script src="js/jquery-2.1.0.js" type="text/javascript" charset="utf-8"></script>
		<script type="text/javascript">
			$(function() {
//				$("#visible").html("页面可见区：" + $(document).width() + "x" + $(document).height());
//				$("#screen").html("屏幕分辨率：" + $(window)["0"].screen.width + "x" + $(window)["0"].screen.height);
				
				//兼容方案
				$("#visible").html("页面可见区：" + $(".layer").width() + "x" + $(".layer").height());
				$("#screen").html("屏幕分辨率：" + $(".layer").width() + "x" + $(window)["0"].screen.height*($(".layer").width()/$(window)["0"].screen.width));
				$("#ratio").html("设备像素比：" + $(window)["0"].devicePixelRatio);
			});
		</script>
	</body>
</html>
